home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / itrns211.zip / LIB / ITRANS.PRO < prev    next >
Text File  |  1991-09-05  |  4KB  |  108 lines

  1. % Prolog for the itrans program...
  2. % RCSID: $Header: e:/itrans/lib/rcs/itrans.pro 1.2 91/09/05 21:49:25 aginash Exp $
  3. %
  4. % ========================================================================== 
  5. % Copyright 1991 Avinash Chopde, All Rights Reserved.
  6. %
  7. % Permission to use, copy, modify and distribute this software and its
  8. % documentation for any purpose is hereby granted without fee, provided that
  9. % the above copyright notice appear in all copies and that both that
  10. % copyright notice and this permission notice appear in supporting
  11. % documentation, and that the name of Avinash Chopde not be used in
  12. % advertising or publicity pertaining to distribution of the software
  13. % without specific, written prior permission.
  14. % Avinash Chopde makes no representations about the suitability of this
  15. % software for any purpose.
  16. % It is provided "as is" without express or implied warranty.
  17. %
  18. % AVINASH CHOPDE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  19. % INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
  20. % IN NO EVENT SHALL AVINASH CHOPDE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21. % CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  22. % DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  23. % TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  24. % OF THIS SOFTWARE.
  25. %
  26. % Author:  Avinash Chopde, 1991
  27. %        C2 Colonial Drive #4, Andover, MA 01810, USA.
  28. %
  29.  
  30. /endx 500 def
  31. /endy 790 def
  32. /EMSIZE 40 def
  33. % program redefines EMSIZE value, otherwise use 40 point size
  34.  
  35. /checkline {  % -- checkline  -> -- (uses EMSIZE global variable)
  36.     currentpoint
  37.     % (in checkline) == pstack
  38.     /y exch def
  39.     EMSIZE add endx ge { % add EMSIZE to x on stack
  40.             /y y EMSIZE sub def % go to next line
  41.         y 10 le { % check if overflow on next page
  42.         /y endy def
  43.         showpage
  44.         } if
  45.  
  46.         50 y moveto
  47.     }  if % x > endx, reached end of line
  48.     % (end of checkline) == pstack
  49. } def
  50.  
  51. /newline {
  52.     currentpoint
  53.     % (in checkline) == pstack
  54.     /y exch def
  55.     pop
  56.     /y y EMSIZE sub def % go to next line
  57.     y 10 le { % check if overflow on next page
  58.     /y endy def
  59.     showpage
  60.     } if
  61.     50 y moveto
  62. } def
  63.  
  64. /EM { % expects a em-unit on stack, converts it to PostScript points
  65.     EMSIZE mul
  66. } def
  67.  
  68.  
  69. /BASEFONTNAME /Devnac def % this should be redefined by the itrans program..
  70.               % so that it refers to the correct font name.
  71.  
  72. /basefont {
  73.     BASEFONTNAME findfont
  74. } def
  75.  
  76. /currentfontsize { % pushes the current font size on the stack
  77.     EMSIZE
  78. } def
  79.  
  80. % <fontsize in points> slantfont --
  81. /normalfont {        % sets font to be the normal font of BASEFONTNAME
  82.     /EMSIZE exch def
  83.     basefont [EMSIZE 0 0 EMSIZE 0 0] makefont setfont
  84. } def
  85.  
  86. % <fontsize in points> slantfont --
  87. /slantfont {        % sets up a slanted version of font BASEFONTNAME
  88.     /EMSIZE exch def
  89.     basefont [EMSIZE 0  0.167 EMSIZE mul  EMSIZE 0 0] makefont setfont
  90. } def
  91.  
  92. % <fontsize in points> expandedfont --
  93. /expandedfont {     % expanded version of BASEFONTNAME
  94.     /EMSIZE exch def
  95.     basefont [EMSIZE 1.2 mul  0 0 EMSIZE 0 0] makefont setfont
  96. } def
  97.  
  98. % <fontsize in points> compressedfont --
  99. /compressedfont {     % compressed (x-axis) version of BASEFONTNAME
  100.     /EMSIZE exch def
  101.     basefont [EMSIZE 0.82 mul  0 0 EMSIZE 0 0] makefont setfont
  102. } def
  103.  
  104. % <fontsize in points> englishfont --
  105. /englishfont {
  106.     /Times-Roman findfont exch scalefont setfont
  107. } def
  108.